import qs from 'qs'
import request from '@/utils/request'
// 签名
import _bale from '@/utils/package'
// 获取不同的接口地址
import { ssoApi } from '@/api/index'
// 获取用户登录信息
export function getUserInfo(params) {
  return request({
    url: ssoApi + '/wx/getUserInfo',
    method: 'post',
    loadHide: true, // 是否显示加载中
    data: qs.stringify(_bale('getUserInfo', params))
  })
}
// 微信参数
export function getWxParam(params) {
  return request({
    url: '/wx/getParam',
    method: 'post',
    data: qs.stringify(_bale('getParam', params))
  })
}
// 微信认证
export function getAuthUrl(params) {
  return request({
    url: ssoApi + '/wx/getAuthUrl',
    method: 'post',
    data: qs.stringify(_bale('getAuthUrl', params))
  })
}

// 查询用户地址List
export function getAddressList(params) {
  return request({
    url: '/userAddress/seleteUserAddressList',
    method: 'post',
    data: qs.stringify(_bale('seleteUserAddressList', params))
  })
}

// 获取地址详情
export function updateUserAddress(params) {
  return request({
    url: '/userAddress/addUserAddress',
    method: 'post',
    data: qs.stringify(_bale('addUserAddress', params))
  })
}

// 获取地址详情
export function getUserAddress(params) {
  return request({
    url: '/userAddress/selectUserAddress',
    method: 'post',
    data: qs.stringify(_bale('getUserInfo', params))
  })
}
// 删除用户地址
export function delUserAddress(params) {
  return request({
    url: '/userAddress/deleteUserAddress',
    method: 'post',
    data: qs.stringify(_bale('deleteUserAddress', params))
  })
}
